import pymysql

# 创建数据库连接池
from dbutils.pooled_db import PooledDB



######### 数据库配置
# 创建连接池
pool = PooledDB(
    creator=pymysql,  # 使用pymysql作为数据库连接器
    maxconnections=6,  # 连接池最大连接数
    mincached=2,      # 初始化时，连接池中至少创建的空闲的链接
    maxcached=5,      # 连接池中最多闲置的链接
    maxshared=3,      # 链接最大共享数
    blocking=True,    # 连接池中如果没有可用连接后，是否阻塞等待
    maxusage=None,    # 一个链接最多被重复使用的次数，None表示无限制
    setsession=[],    # 开始会话前执行的命令列表
    ping=0,           # ping MySQL服务端，检查是否服务可用
    host='1.194.161.112',
    user='root',
    port=13049,
    password='mh1e!8:G.@Jg^CD',
    database='mapping_and_api',
    charset='utf8mb4'
)

# 从连接池获取连接
conn = pool.connection()
cursor = conn.cursor()# 最大线程数


MAX_WORKERS = 1
# 远程数据库推送地址
REMOTE_DB_PUSH_URL = "http://xdrj.lottefuture.com/zxy/V1/Gen2/ed1XF/lineReportController/receive/method"

HEADERS = {
    'sec-ch-ua-platform': '"Windows"',
    'Referer': 'https://m.weibo.cn',
    # 'sec-ch-ua': '"Chromium";v="136", "Google Chrome";v="136", "Not.A/Brand";v="99"',
    "Connection": "close",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",
}


# PROXY = {
#         "http": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel},
#         "https": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel}
#     }

PROXY =None

DEBUG = True

OTHER_PATH = "./other/"


if  DEBUG:
    DRIVER_PATH = "./chromedriver-win64/chromedriver.exe"
    JS_PATH= './drag_captcha'
else:
    DRIVER_PATH = "my_selenium/chromedriver-win64/chromedriver.exe"
    JS_PATH = 'my_selenium/drag_captcha'



